package com.foreknow.elm.controller;

import com.foreknow.elm.po.Food;
import com.foreknow.elm.service.FoodService;
import com.foreknow.elm.service.impl.FoodServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

public class FoodController {
    /**
     * 根据商家Id查询食品信息
     * @param req
     * @return (list extends Object)
     * @throws Exception
     */
    public Object listFoodByBusinessId(HttpServletRequest req) throws Exception {
        int businessId = Integer.parseInt(req.getParameter("businessId"));
        FoodService service = new FoodServiceImpl();
        List<Food> list = service.listFoodByBusinessId(businessId);
        return list;
    }
}
